package com.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * AccpSubject entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ACCP_SUBJECT", schema = "ACCP", uniqueConstraints = @UniqueConstraint(columnNames = "SNAME"))
public class AccpSubject implements java.io.Serializable {

	// Fields

	private Integer sid;
	private AccpBiz accpBiz;
	private AccpGrade accpGrade;
	private String sname;
	private Set<AccpVote> accpVotes = new HashSet<AccpVote>(0);
	private Set<AccpSubjectitems> accpSubjectitemses = new HashSet<AccpSubjectitems>(
			0);
	private Set<AccpTask> accpTasks = new HashSet<AccpTask>(0);

	// Constructors

	/** default constructor */
	public AccpSubject() {
	}

	/** minimal constructor */
	public AccpSubject(Integer sid) {
		this.sid = sid;
	}

	/** full constructor */
	public AccpSubject(Integer sid, AccpBiz accpBiz, AccpGrade accpGrade,
			String sname, Set<AccpVote> accpVotes,
			Set<AccpSubjectitems> accpSubjectitemses, Set<AccpTask> accpTasks) {
		this.sid = sid;
		this.accpBiz = accpBiz;
		this.accpGrade = accpGrade;
		this.sname = sname;
		this.accpVotes = accpVotes;
		this.accpSubjectitemses = accpSubjectitemses;
		this.accpTasks = accpTasks;
	}

	// Property accessors
	@Id
	@Column(name = "SID", unique = true, nullable = false, precision = 8, scale = 0)
	public Integer getSid() {
		return this.sid;
	}

	public void setSid(Integer sid) {
		this.sid = sid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BID")
	public AccpBiz getAccpBiz() {
		return this.accpBiz;
	}

	public void setAccpBiz(AccpBiz accpBiz) {
		this.accpBiz = accpBiz;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "GID")
	public AccpGrade getAccpGrade() {
		return this.accpGrade;
	}

	public void setAccpGrade(AccpGrade accpGrade) {
		this.accpGrade = accpGrade;
	}

	@Column(name = "SNAME", unique = true)
	public String getSname() {
		return this.sname;
	}

	public void setSname(String sname) {
		this.sname = sname;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpSubject")
	public Set<AccpVote> getAccpVotes() {
		return this.accpVotes;
	}

	public void setAccpVotes(Set<AccpVote> accpVotes) {
		this.accpVotes = accpVotes;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpSubject")
	public Set<AccpSubjectitems> getAccpSubjectitemses() {
		return this.accpSubjectitemses;
	}

	public void setAccpSubjectitemses(Set<AccpSubjectitems> accpSubjectitemses) {
		this.accpSubjectitemses = accpSubjectitemses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpSubject")
	public Set<AccpTask> getAccpTasks() {
		return this.accpTasks;
	}

	public void setAccpTasks(Set<AccpTask> accpTasks) {
		this.accpTasks = accpTasks;
	}

}